import {createApp} from 'vue'
import ElementPlus from "element-plus";
import * as ElementPlusIcons from "@element-plus/icons-vue"; // 图标
import router from "@/router";
import "@/permission";

import "element-plus/theme-chalk/index.css";
import "element-plus/theme-chalk/dark/css-vars.css";
import '@/assets/styles/index.scss';
import '@/assets/styles/gen.scss';
import '@/assets/styles/element-variables.scss';

import App from './App.vue'
// 图片组件
import SvgIcon from "@/components/SvgIcon/index.vue";
// 分页组件
import Pagination from "@/components/Pagination/index.vue";
// 搜索组件
import RightToolbar from "@/components/RightToolbar/index.vue";
import {addDateRange, resetForm} from "@/utils/gen";
import {commdown} from '@/utils/down';
import modal from '@/plugins/modal';
import download from '@/plugins/download';

const app = createApp(App)

// 每个图标组件调用 app.component 方法注册为全局组件
for (const [key, component] of Object.entries(ElementPlusIcons)) {
    app.component(key, component);
}

app.config.globalProperties.resetForm = resetForm
app.config.globalProperties.addDateRange = addDateRange
app.config.globalProperties.commdown = commdown
app.config.globalProperties.model = modal
app.config.globalProperties.download = download

app.use(ElementPlus);
app.use(router);

app.component("Pagination", Pagination);
app.component("SvgIcon", SvgIcon);
app.component("RightToolbar", RightToolbar);

app.mount('#app')
